-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename branch status modif by operational status modif #377
rename branch status modif by operational status modif #377
Conversation
BRANCH_ACTION_TYPE_UNKNOWN(HttpStatus.BAD_REQUEST), | ||
BRANCH_ACTION_TYPE_UNSUPPORTED(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_EMPTY(HttpStatus.BAD_REQUEST, "Empty equipment action type"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty operational status action type ?
BRANCH_ACTION_TYPE_EMPTY(HttpStatus.BAD_REQUEST, "Empty branch action type"), | ||
BRANCH_ACTION_TYPE_UNKNOWN(HttpStatus.BAD_REQUEST), | ||
BRANCH_ACTION_TYPE_UNSUPPORTED(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPERATIONAL_STATUS_ACTION_ERROR
BRANCH_ACTION_TYPE_UNKNOWN(HttpStatus.BAD_REQUEST), | ||
BRANCH_ACTION_TYPE_UNSUPPORTED(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_EMPTY(HttpStatus.BAD_REQUEST, "Empty equipment action type"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPERATIONAL_STATUS_ACTION_TYPE_EMPTY
BRANCH_ACTION_TYPE_UNSUPPORTED(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_EMPTY(HttpStatus.BAD_REQUEST, "Empty equipment action type"), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_UNKNOWN(HttpStatus.BAD_REQUEST), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPERATIONAL_STATUS_ACTION_TYPE_UNKNOWN
OPERATIONAL_EQUIPMENT_ACTION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_EMPTY(HttpStatus.BAD_REQUEST, "Empty equipment action type"), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_UNKNOWN(HttpStatus.BAD_REQUEST), | ||
OPERATIONAL_EQUIPMENT_ACTION_TYPE_UNSUPPORTED(HttpStatus.INTERNAL_SERVER_ERROR), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPERATIONAL_STATUS_ACTION_TYPE_UNSUPPORTED
@@ -150,8 +150,8 @@ public static NetworkModificationException createEquipmentTypeUnknown(@NonNull S | |||
return new NetworkModificationException(Type.UNKNOWN_EQUIPMENT_TYPE, "The equipment type : " + type + " is unknown"); | |||
} | |||
|
|||
public static NetworkModificationException createBranchActionTypeUnsupported(@NonNull BranchStatusModificationInfos.ActionType type) { | |||
return new NetworkModificationException(Type.BRANCH_ACTION_TYPE_UNSUPPORTED, "The branch action type : " + type + " is unsupported"); | |||
public static NetworkModificationException createBranchActionTypeUnsupported(@NonNull OperationalStatusModificationInfos.ActionType type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createOperationalStatusActionTypeUnsupported
public static NetworkModificationException createBranchActionTypeUnsupported(@NonNull BranchStatusModificationInfos.ActionType type) { | ||
return new NetworkModificationException(Type.BRANCH_ACTION_TYPE_UNSUPPORTED, "The branch action type : " + type + " is unsupported"); | ||
public static NetworkModificationException createBranchActionTypeUnsupported(@NonNull OperationalStatusModificationInfos.ActionType type) { | ||
return new NetworkModificationException(Type.OPERATIONAL_EQUIPMENT_ACTION_TYPE_UNSUPPORTED, "The branch action type : " + type + " is unsupported"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operational status action type : " + type + " is unsupported
public class BranchStatusModificationInfos extends EquipmentModificationInfos { | ||
@Schema(description = "Operational status modification") | ||
@JsonTypeName("OPERATIONAL_STATUS_MODIFICATION") | ||
@ModificationErrorTypeName("OPERATIONAL_EQUIPMENT_ACTION_ERROR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPERATIONAL_STATUS_ACTION_ERROR
|
||
private void applyTripEquipment(Reporter subReporter, Identifiable<?> equipment, String equipmentTypeName, Network network) { | ||
Tripping trip = null; | ||
if (equipment instanceof Branch<?>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a method to return the tripping class to use from the equiment type
And throw an exception the equipement type is not treated
traversedTerminals.stream().map(t -> network.getIdentifiable(t.getConnectable().getId())) | ||
.filter(Objects::nonNull) | ||
.filter(distinctByKey(b -> b.getId())) // dont process the same branch more than once | ||
.forEach(b -> b.newExtension(BranchStatusAdder.class).withStatus(BranchStatus.Status.FORCED_OUTAGE).add()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a method which add the extension type from the the equipment type
…ationalStatusModif' into rename-BranchStatusModif-to-OperationalStatusModif
Kudos, SonarCloud Quality Gate passed! |
throw NetworkModificationException.createEquipmentTypeUnknown(identifiable.getClass().getSimpleName()); | ||
} | ||
|
||
public Tripping getTrippingFromIdentifiable(@NonNull Identifiable<?> identifiable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This methos is specific to the operation status modification
Move it
@@ -514,6 +520,39 @@ public Terminal getTerminalFromIdentifiable(Network network, String equipmentId, | |||
return null; | |||
} | |||
|
|||
public Set<Terminal> getTerminalsFromIdentifiable(@NonNull Identifiable<?> identifiable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a set ?
return new BranchTripping(branch.getId()); | ||
} else if (identifiable instanceof ThreeWindingsTransformer w3t) { | ||
return new ThreeWindingsTransformerTripping(w3t.getId()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HVDC ?
hvdcLine.getConverterStation2().getTerminal() | ||
).collect(Collectors.toSet()); | ||
} | ||
throw NetworkModificationException.createEquipmentTypeUnknown(identifiable.getClass().getSimpleName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This methos is specific to the operation status modification
Move it
And throw equipmentTypeNotSupported
Use powsybl getTerminals
method
return new ThreeWindingsTransformerTripping(w3t.getId()); | ||
} | ||
throw NetworkModificationException.createOperationalStatusActionTypeUnsupported(OperationalStatusModificationInfos.ActionType.TRIP); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw equipmentTypeNotSupported
…sModif # Conflicts: # src/main/resources/db/changelog/db.changelog-master.yaml
No description provided.